package com.hskn.hss.module.insuranceCfg.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hskn.hss.core.annotation.DataScope;
import com.hskn.hss.core.domain.BaseEntity;
import com.hskn.hss.entity.AjaxResult;
import com.hskn.hss.exception.ExcelReaderDataException;
import com.hskn.hss.exception.HssException;
import com.hskn.hss.module.insuranceCfg.entity.TlInsuranceCfg;
import com.hskn.hss.module.insuranceCfg.to.InsuranceCfgListTO;
import com.hskn.hss.to.ForIdsTO;
import org.springframework.transaction.annotation.Transactional;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author hskn
 * @since 2021-05-06
 */
public interface ITlInsuranceCfgService extends IService<TlInsuranceCfg> {
    AjaxResult insert(JSONObject params) throws HssException;

    AjaxResult update(JSONObject params) throws HssException;

    @Transactional(rollbackFor = {RuntimeException.class, Error.class})
    AjaxResult deleteByid(ForIdsTO forIdsTO) throws HssException;

    TlInsuranceCfg getDetailById(JSONObject params) throws HssException;

    @DataScope(deptAlias = "deptidforcar", userAlias = "creatBy")
    JSONObject getList(BaseEntity baseEntity, JSONObject params) throws HssException;

    @DataScope(deptAlias = "deptidforcar", userAlias = "creatBy")
    List<TlInsuranceCfg> getTlInsuranceCfgList(InsuranceCfgListTO insuranceCfgListTo, SimpleDateFormat format) throws ParseException;

    void excelReader(List<TlInsuranceCfg> InsuranceCfgList) throws ExcelReaderDataException;
}
